package com.telit.uav.feign.fallBack;


import com.telit.common.dto.SysUserRolePageDto;
import com.telit.common.enums.ResultCode;
import com.telit.common.vo.user.Result;
import com.telit.common.vo.user.SysUserInfoVo;
import com.telit.common.vo.user.SysUserShortVo;
import com.telit.uav.feign.UpmsFeignClient;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.List;


/**
 * @Auther amy
 * @Describe
 */
@Component
@Slf4j
public class UpmsFeignClientFallBack implements UpmsFeignClient {
    @Setter
    private Throwable cause;

    @Override
    public Result<List<SysUserShortVo>> queryUserListByIds(List<Long> ids) {
        log.error("feign 查询用户详情接口失败:{}", cause);
        return null;
    }

    @Override
    public Result getUserDetail(Long id) {
        log.error("feign 查询用户详细信息:{}", cause);
        return null;
    }

    @Override
    public Result<List<SysUserShortVo>> getListForRole(SysUserRolePageDto sysUserRolePageDto) {
        log.error("feign 无分页查询用户所有详情失败:{}", cause);
        return new Result<>(ResultCode.SERVER_FEIGN_ERROR.getCode(), false, "无分页查询用户信息失败");
    }

    @Override
    public Result<List<SysUserInfoVo>> queryUserInfoByIds2(List<Long> ids) {
        log.error("feign 查询优化用户失败:{}", cause);
        return new Result<>(ResultCode.SERVER_FEIGN_ERROR.getCode(), false, "无分页查询用户信息失败");
    }

}
